%%%-------------------------------------------------------------------
%%% @author liuwentao
%%% @doc
%%%         道具数据升级
%%% @end
%%% Created : 19. 7月 2021 20:37
%%%-------------------------------------------------------------------
-module(item_ver).
-author("liuwentao").

%% API
-export([
    do_items/2
]).

-include("item.hrl").
-include("common.hrl").

do_items([], Acc) -> {ok, lists:reverse(Acc)};
do_items([H | T], Acc) ->
    case do_item(H) of
        {ok, NewH} ->
            do_items(T, [NewH | Acc]);
        Ret ->
            Ret
    end.

%% 道具数据升级
do_item(Item = #item{ver = ?item_ver}) ->
    {ok, Item};

do_item(_I) ->
    {false, ?T("物品数据版本转换")}.